#include <bits/stdc++.h>
using namespace std;
using ll=long long;
vector<ll> arr(1e5);
int main()
{
  ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
  int n=0;cin>>n;
  for(int i=1;i<=n;++i)
  {
    cin>>arr[i];
    if(arr[i]<0) arr[i]*=-1;
  }
  ll ans=0;
  ll a=-1e9;//max
  ll b=1e9;//min
  //sort(arr.begin()+1,arr.begin()+1+n);
  for(int i=1;i<=n;i+=2)
  {
    for(int j=2;j<=n;j+=2)
    {
      a=max(a,arr[i]);
      b=min(b,arr[j]);
      ans=2*(a+b);
    }
  }
  cout<<ans;
  return 0;
}
